home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Magazine Collection 2001
/
Delphi Magazine Collection 20001 (2001).iso
/
DISKS
/
Issue57
/
Clinic
/
HelpTestU.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2000-03-24
|
1KB
|
55 lines
unit HelpTestU;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Panel1: TPanel;
Button1: TButton;
Button2: TButton;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
//Remove WS_EX_CONTROLPARENT, where set, to allow context help to work
procedure FixContextHelp(Form: TCustomForm);
var
Loop, OldExStyle: Integer;
Handle: HWnd;
Control: TControl;
begin
for Loop := 0 to Form.ControlCount - 1 do
begin
Control := Form.Controls[Loop];
if (csAcceptsControls in Control.ControlStyle) and
(Control is TWinControl) then
begin
Handle := TWinControl(Control).Handle;
OldExStyle := GetWindowLong(Handle, GWL_EXSTYLE);
SetWindowLong(Handle, GWL_EXSTYLE,
OldExStyle and not WS_EX_CONTROLPARENT)
end
end
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
FixContextHelp(Self)
end;
end.